<template>
  <div class="app-container">

    <div>
      <label class="radio-label" style="padding-left:0;">文件名： </label>
      <el-input
        v-model="filename"
        placeholder="请输入文件名(默认employee)"
        style="width:350px;"
        prefix-icon="el-icon-document"/>

      <span style="color: grey">
        .xls
      </span>
      <span>
        <el-button
          :loading="downloadLoading"
          style="margin:0 0 20px 20px;"
          type="primary"
          plain
          icon="el-icon-document"
          @click="handleDownload">
          导出 Excel
        </el-button>
      </span>

    </div>
  </div>
</template>

<script>/* eslint-disable indent */

import { exportExcel } from '../../../../api/employee'
import $ from 'jquery'

export default {
  filters: {},
  data() {
    return {
      filename: '',
      downloadLoading: false
    }
  },
  created() {
  },
  methods: {
    handleDownload() {
      this.$message({
        message: '即将开始导出并下载',
        type: 'success'
      })
      if (this.filename === '') {
        this.filename = 'employee'
      }
      exportExcel(this.filename)
    }

  }
}
</script>

<style>
  .el-table .warning-row {
    background: oldlace;
  }

  .el-table .success-row {
    background: #f0f9eb;
  }

  .expanded_input {
    width: 555px;
  }
</style>
